package com.clever.mall.service;

import com.clever.mall.commons.dto.OrderDto;
import com.clever.mall.commons.dto.PayDto;
import com.clever.mall.commons.result.BaseResult;
import com.clever.mall.entity.Order;
import com.clever.mall.vo.IsOrderVo;
import com.clever.mall.vo.OrderVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderService {

    //默认状态值
    public static final int STATUS_DEFAULT = 0;
    //已付款状态
    public static final int STATUS_PAY = 1;
    //订单完成状态
    public static final int STATUS_COMPLETE = 3;

    //退款完成
    public static final int REFUND_STATUS_COMPLETE = 4;

    /**
     * 通过用户id查询用户所有订单
     * @param uid
     * @return
     */
    List<OrderVo> selectOrderAll(int uid);

    /**
     * 通过用户id和状态码查询用户订单
     * @param uid
     * @return
     */
    List<OrderVo> selectOrderByStatus(int uid, String status);

    /**
     * 通过订单id查询用户订单详情
     * @param oid
     * @return
     */
    OrderVo selectOrderDetailsByOrderId(int oid);

    /**
     * 添加单个订单
     * @param orderDto
     * @return
     */
    int insertOrder(OrderDto orderDto);

    int insertOrderList(List<OrderDto> orderDtoList);

    /**
     * 通过订单id删除订单
     * @param oid
     * @return
     */
    int deleteOrderByOrderId(int oid);

    int deleteOrderListByOrderListId(List<Integer> oidList);

    /**
     * 修改订单状态
     * @param orderId
     * @param status
     * @return
     */
    int updateOrderStatus(int orderId, int status);

    /**
     * 修改订单退款状态
     * @param orderId
     * @param refundStatus
     * @return
     */
    int updateOrderRefundStatus(int orderId, int refundStatus);

    /**
     * 确认订单数据
     * @param uid
     * @param pid
     * @return
     */
    IsOrderVo  selectIsOrderVoByUserIdAndProductId(int uid, int pid);

    /**
     * 付款
     * @param payDto
     */
    Boolean pay(PayDto payDto);
}
